package com.example.demo;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * user:likai
 * Date:2023-01-31
 * Time:20:24
 */
//配置集合
@Component
@ConfigurationProperties(prefix = "animals")
@Data
@RestController
public class Animals {
    private List<String> name;
    @RequestMapping("/bbb")
    public String test(){

        return name.get(0);
    }
}
